import request from '@/utils/request'

// 获取教师列表
export function getTeachers(params) {
  return request.get('/teacher/list', params)
}

// 新增教师
export function insertTeacher(data) {
  // 转换数据格式
  const postData = {
    ...data,
    instrumentIds: data.instruments
  }
  return request.post('/teacher/insert', postData)
}

// 更新教师
export function updateTeacher(data) {
  // 转换数据格式
  const postData = {
    ...data,
    instrumentIds: data.instruments
  }
  return request.post('/teacher/update', postData)
}

// 删除教师
export function deleteTeacher(ids) {
  return request.get('/teacher/delete', { params: { ids } })
}
